package o;

import android.app.Activity;
import android.content.Context;
import android.provider.Settings.Secure;
import com.huawei.appmarket.service.studentmode.ProxyActivity;
import com.huawei.appmarket.service.studentmode.view.ProxyActivityProtocol;

public final class ejj {
    private static ejj ˊ;
    private static final Object ˋ = new Object();

    public interface b {
        void ˊ();

        void ˏ();

        void ॱ();
    }

    private ejj() {
    }

    public static ejj ˊ() {
        ejj o_ejj;
        synchronized (ˋ) {
            if (ˊ == null) {
                ˊ = new ejj();
            }
            o_ejj = ˊ;
        }
        return o_ejj;
    }

    public boolean ˎ() {
        egv ॱᐝ = egv.ॱᐝ();
        if (ॱᐝ.ॱˎ()) {
            return ॱॱ() && ॱᐝ.ʻॱ();
        } else {
            return ॱ();
        }
    }

    public void ˏ(Context context, ejf o_ejf) {
        if (context == null) {
            Logger.ˋ("ChildModeManager", "context == null");
            context = ContentManager.getInstant().getContext();
        }
        ProxyActivity.ˊ(o_ejf);
        cjm o_cjm = new cjm("child.mode.proxy.activity", new ProxyActivityProtocol());
        if (!(context instanceof Activity)) {
            o_cjm.ॱ(context).setFlags(268435456);
        }
        cjk.ˎ().ˋ(context, o_cjm);
    }

    protected int ˋ() {
        return Secure.getInt(ContentManager.getInstant().getContext().getContentResolver(), "parentcontrol_appinstall", -1);
    }

    protected int ˏ() {
        return Secure.getInt(ContentManager.getInstant().getContext().getContentResolver(), "childmode_status", -1);
    }

    public boolean ॱ() {
        return ˏ() == 1;
    }

    public boolean ॱॱ() {
        return ˋ() == 2;
    }
}
